cmake_minimum_required(VERSION 3.16)
project(StudentSys C)


set(CMAKE_C_STANDARD 11)
# default is "Debug"
set(CMAKE_BUILD_TYPE "Release")

#SET(CMAKE_C_COMPILER "D:/program/winlibs-x86_64-posix-seh-gcc-12.2.0-llvm-15.0.7-mingw-w64ucrt-10.0.0-r4/mingw64/bin/clang.exe")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -O3 -g3 -Wall")
SET (CMAKE_C_FLAGS                "-Wall -std=c99")
SET (CMAKE_C_FLAGS_DEBUG          "-g")
SET (CMAKE_C_FLAGS_MINSIZEREL     "-Os -DNDEBUG")
SET (CMAKE_C_FLAGS_RELEASE        "-O3 -DNDEBUG")
SET (CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g")

#SET (CMAKE_CXX_COMPILER             "D:/program/winlibs-x86_64-posix-seh-gcc-12.2.0-llvm-15.0.7-mingw-w64ucrt-10.0.0-r4/mingw64/bin/clang++.exe") # 填写绝对路径
SET (CMAKE_CXX_FLAGS                "-Wall")
SET (CMAKE_CXX_FLAGS_DEBUG          "-g")
SET (CMAKE_CXX_FLAGS_MINSIZEREL     "-Os -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELEASE        "-O3 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")

aux_source_directory(./ SRC) #源文件目录(当前目录设置到变量DIR_SRC)
add_executable(StudentSys ${SRC})
target_sources(StudentSys  PRIVATE ${DIR_SRC})